package com.chuck.blogpro.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private String msg;
    private Object data;
    private int code; // 成功 1：失败：0


    public static Result success() {
        return new Result("success", null, 1);
    }

    public static Result success(Object data) {
        return new Result("success", data, 1);
    }

    public static Result error(String msg) {
        return new Result(msg, null, 0);
    }
}
